home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / scan21.zip / SCAN.DOC < prev    next >
Text File  |  1988-07-05  |  7KB  |  139 lines

  1.          SCAN - A utility to scan binary files for text strings.
  2.  
  3.          USAGE:  SCAN +<on> -<off> {infile} {outfile}
  4.  
  5.          where:
  6.          +<on>           List of switches to activate.
  7.          -<off>          List of switches to deactivate.
  8.          {infile}        Name of input file.
  9.          {outfile}       Name of output file.
  10.                          You may use / or \ in pathnames if they are 
  11.                          supplied as parameters (as opposed to command-
  12.                          line redirection)
  13.  
  14.          The minimum length a string must be to be printed may be changed 
  15.          by including a digit (1-9) in any of the - or + switch sets.  The 
  16.          last digit given is used.
  17.  
  18.          SCAN ? will present a brief list of options.
  19.  
  20.          Arguments may be in any order.  To give an output file, you must 
  21.          give an input file.  If no file names are given, SCAN uses 
  22.          standard input & standard output so you may also use command-line
  23.          redirection and pipes.
  24.  
  25.          WHAT IT DOES:  SCAN reads a binary file and prints any text 
  26.          strings it finds.  A text string is defined (by default) as:
  27.  
  28.          1)     All characters in the printable ASCII range--SPACE through
  29.                 ~.  The tab character (^I) is also considered printable.
  30.          2)     At least four characters long.  May be overridden with the
  31.                 1-9 character length switches.
  32.  
  33.          Any strings found are printed to standard output or the specified
  34.          output file, one per line.
  35.  
  36.          OPTIONS:  A number of options modify SCAN's filtering:
  37.  
  38.               H    Treat character values 128-255 as printable.
  39.               ?    Treat foreign (high bit) characters as printable.
  40.               G    Treat graphics characters as printable (the set from
  41.                    ASCII 176 to 223 decimal).
  42.               #    Print characters above ASCII 127 as '\<ASCII>'.
  43.               .    Print characters above ASCII 127 as '.'.
  44.               %    Strip high bits from input.
  45.          *    {    Strip leading spaces from strings.
  46.               }    Strip trailing spaces from strings.
  47.          *    S    Maximum output string length is (+)72
  48.                    or (-)255 characters.
  49.               U    Translate output to upper case.
  50.               B    Display space as '_'.
  51.               E    String must contain at least one consonant
  52.                    and one vowel (a,e,i,o,u,y) to be printed.
  53.               $    Display ESCape as '\$'.  ESC becomes printable.
  54.               C    Display CR as '\C'.  CR becomes printable.
  55.               L    Display LF as '\L'.  LF becomes printable.
  56.               F    Display FF as '\F'.  FF becomes printable.
  57.          *    T    Make TAB a printable character.
  58.               @    Display tabs as '\T' (implies T).
  59.               \    Display \ as '\\'.  Useful with $, @, C, L, F.
  60.               0    Display NULLs (as '\0').  A null still ends a string.
  61.               !    String must end in NULL to be displayed (does NOT
  62.                    imply 0--Set 0 if you want to SEE nulls).
  63.               1-9  Minimum length for a printable string is set to
  64.                    the value given (treated identically whether - or +).
  65.  
  66.               * means the option is turned ON by default.  Otherwise
  67.               it is turned OFF.
  68.  
  69.               "Printable" means a character is included in a text string.
  70.               "Non-printable" means a character isn't included, and ENDS
  71.               a text string if encountered.
  72.  
  73.          NOTES
  74.          *    Turning on @, $, C, L, F, * or 0 turns on \ (you may over-
  75.               ride this by explicitly turning off \ later in the 
  76.               command line).
  77.          *    Turning on H turns off ? and G.  Turning on ? or G turns
  78.               off H.
  79.          *    # has precedence over ..  If both are turned off, hi-bit
  80.               characters are printed directly (note you must turn on H,
  81.               ?, or G to get any hi-bit characters).
  82.          *    Setting % turns off H, ?, and G.
  83.          *    Option U handles the international characters for those 6 or
  84.               so characters which have both upper- and lower-case versions.
  85.  
  86.          EXAMPLES:
  87.          SCAN foo.doc -{} +% -- Read FOO.DOC, leaving leading & trailing
  88.                                 spaces, and stripping high bits in case 
  89.                                 it's a Wordstar file
  90.  
  91.          SCAN +!e -t nethack.exe -- Find all the spoilers in NETHACK :-)
  92.          
  93.          BUGS:
  94.          Don't invoke SCAN without specifying some input file--SCAN opens 
  95.          stdin as a binary file and will ignore control-Z, so you'll have
  96.          to hit ctrl-C to break out of the program.
  97.  
  98.          Extra file names on the command line are totally ignored.  
  99.          Wildcards in the input file name are not supported.
  100.  
  101.          AUTHOR:        Kenneth J. Herron
  102.                         111 Buchanan Street
  103.                         Lexington, Kentucky  40508
  104.  
  105.               Like the program says, SCAN is placed in the public domain.
  106.  
  107.          HISTORY:
  108.          1.0:   (12/??/87)  First working version.
  109.          1.5:   (12/23/87)  First released version.
  110.          1.6:   (3/22/88)  Added help screen.  Made some minor changes to 
  111.                 improve execution speed about 8-10%.  Fixed bug in which
  112.                 only the first 255 characters of a too-long string were 
  113.                 saved.  Fixed bug in which the minimum length was set to 3, 
  114.                 rather than the declared default minimum, if a / switch is 
  115.                 given with an unintelligible argument.
  116.          2.0    (5/1/88) Removed the 'strip high bits on output' option--
  117.                 couldn't think of any use for it.
  118.                 Made the digits 1-9 into switches for minimum string 
  119.                 length.  Previously, minimum length was set with a special 
  120.                 option flagged with /.  This change allows using / in file 
  121.                 pathnames.
  122.                 Changed the logic of the NULL-related switches and the
  123.                 high-bit-related switches.  Now you can select only null- 
  124.                 terminated strings without having to see the nulls.
  125.                 Changed the characters used for some options, mostly
  126.                 to make them mnemonic.
  127.                 Added the short/long output lines option so long runs of 
  128.                 text don't break up so weird (now they break up a different 
  129.                 weird).  Output is short by default.
  130.                 Added the graphics set switch and the two hi-bit conversion 
  131.                 switches (Convert-to-dot and convert-to-ASCII).
  132.          2.1    (7/5/88) Following a USENET posting from Torsten Olsson of 
  133.                 Sweden, implemented an UPCASE function which handles the 
  134.                 PC's international characters.  This function is written as 
  135.                 a unit and may be incorporated into any program 
  136.                 transparently.
  137.                 Removed the greek characters from the foreign character
  138.                 set and added the quote marks #174 & #175.
  139.